// 头部粒子效果================================= 
//配置
var config = {
    vx: 4,	//小球x轴速度,正为右，负为左
    vy: 4,	//小球y轴速度
    height: 2,	//小球高宽，其实为正方形，所以不宜太大
    width: 2,
    count: 200,		//点个数
    color: "0,0,0", 	//点颜色
    stroke: "0,0,0", 		//线条颜色
    dist: 6000, 	//点吸附距离
    e_dist: 20000, 	//鼠标吸附加速距离
    max_conn: 10 	//点到点最大连接数
}

//调用
CanvasParticle(config);


// 添加底部合作伙伴模组移入移出效果
// 获取元素
const bodysPartnerLi = document.querySelectorAll(".bodys-partner li");
// 伙伴模组数据
let PartnerTa = [
    "more-partners-item01.svg",
    "more-partners-item02.svg",
    "more-partners-item03.svg",
    "more-partners-item04.svg",
    "more-partners-item05.svg",
    "more-partners-item06.svg",
    "more-partners-item07.svg",
    "more-partners-item08.svg",
    "more-partners-item09.svg",
];
let PartnerTa2 = [
    "zgyidong.svg",
    "zhaoshang.svg",
    "zgyinlian.svg",
    "jingdong.svg",
    "douyin.svg",
    "meituan.svg",
    "xiaomi.svg",
    "xiaomi.svg",
    "kuaishou.svg",
];

for (let i = 0; i < bodysPartnerLi.length; i++) {
    // M默认显示的图片
    bodysPartnerLi[i].innerHTML = `
        <img src="./imge/images/${PartnerTa[i]}" alt="">
        `;
    // 添加移入移出效果
    bodysPartnerLi[i].addEventListener("mouseenter", function () {
        bodysPartnerLi[i].style.backgroundColor = "rgb(12, 117, 238)";
        bodysPartnerLi[i].innerHTML = `
               <img src="./imge/images/${PartnerTa2[i]}" alt="">
               `
    });
    bodysPartnerLi[i].addEventListener("mouseleave", function () {
        bodysPartnerLi[i].style.backgroundColor = "rgb(255, 255, 255)";
        bodysPartnerLi[i].innerHTML = `
               <img src="./imge/images/${PartnerTa[i]}" alt="">
               `
    })
}

/* 侧面页面模组导航======================== */
// 获取元素
const bodysNav = document.querySelector(".bodys-nav");
const bodysNavSpan = document.querySelectorAll(".bodys-nav span");
// 卷动事件
window.addEventListener("scroll", function () {
    if (scrollY >= 300) {
        bodysNav.style.display = "block"
    } else { bodysNav.style.display = "none" }
});
// 点击事件
for (let i = 0; i < bodysNavSpan.length; i++) {
    bodysNavSpan[i].addEventListener("click", function () {
        if (i == 0) { window.scrollTo(0, 300) }
        else if (i == 1) { window.scrollTo(0, 850) }
        else if (i == 2) { window.scrollTo(0, 1250) }
        else if (i == 3) { window.scrollTo(0, 1655) }
    })
}
// 进行本地页面跳转======
// 获取元素
const  bodysLi=document.querySelectorAll(".bodys>ul li");
console.log(bodysLi)
bodysLi.forEach(function(v,i){
    console.log(v)
    v.addEventListener("click",function(){
        console.log("aaa")
        window.location.href="06case-details.html";
    })
})
